import _enum from "./enum";

export function statusName(status) {
	let name = ''
	let sta = _enum.status

	switch (status) {
		case sta.rescuePending: {
			name = "待下单"
		}
		break;
		case sta.PendingConfirmOrder: {
			name = "待接单"
		}
		break;
		case sta.ConfirmOrder: {
			name = "已接单"
		}
		break;
		case sta.ProcessingOrder: {
			name = "在途中"
		}
		break;
		case sta.InService: {
			name = "服务中"
		}
		break;
		case sta.ToBeEvaluated: {
			name = "待评价"
		}
		break;
		case sta.Finished: {
			name = "已完成"
		}
		break;
		case sta.AfterSalesService: {
			name = "退款/售后"
		}
		break;

		/**
		 * 预约订单状态码
		 */
		case sta.reserveStatusPending: {
			name = "待上门"
		}
		break;
		case sta.reserveStatusInService: {
			name = "服务中"
		}
		break;
		case sta.reserveStatusFinished: {
			name = "已完成"
		}
		break;
		case sta.reserveStatusCancel: {
			name = "已取消"
		}
		break;
		default:
			break;
	}
	// 	 console.log("status----------------"+status)
	// console.log("name----------------"+name)
	return name;
}

export function getShopName(status) {
	let name = ''
	let sta = _enum.shopType

	switch (status) {
		case sta.shopTypeRescue: {
			name = "救援"
		}
		break;
		case sta.shopTypeRecovery: {
			name = "二手车回收"
		}
		break;
		case sta.shopTypeRental: {
			name = "租车"
		}
		break;
		case sta.shopTypeRepair: {
			name = "到店维修"
		}
		break;

		default:
			break;
	}

	return name;
}



/**
 * @description  如果为救援订单，状态码不变，如果为预约订单，则状态码加上100
 * @param {Object} status	状态码
 * @param {Object} orderType 订单类型
 */
export function getStatus(status, orderType) {
	let s = ''
	let orderTypes = _enum.orderType

	if (orderType == orderTypes.reserveOrder) {
		s = 100 + parseInt(status)
	} else {
		s = status
	}


	return s

}